package Yang.demo02;

import lombok.Setter;

public class UserProxy implements UserService {
    @Setter
    private UserServiceImpl userService;

    public UserProxy() {
    }

    @Override
    public void add() {
        log("add");
        userService.add();
    }

    @Override
    public void delete() {
        log("delete");
        userService.delete();
    }

    @Override
    public void update() {
        log("update");
        userService.update();
    }

    @Override
    public void query() {
        log("query");
        userService.query();
    }

    public void log(String msg){
        System.out.println("[Debug] 使用了"+msg+"方法");
    }
}
